package cn.vcjf.weapp.api.goods.service.impl;

import cn.vcjf.weapp.api.goods.entity.GoodsInfo;
import cn.vcjf.weapp.api.goods.mapper.GoodsInfoMapper;
import cn.vcjf.weapp.api.goods.service.GoodsInfoService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhengzihang
 * @since 2018-09-25
 */
@Service("goodsInfoService")
public class GoodsInfoServiceImpl extends ServiceImpl<GoodsInfoMapper, GoodsInfo> implements GoodsInfoService {

	@Override
	public Page<GoodsInfo> findHotGoodList(Page<GoodsInfo> page,GoodsInfo goodsInfo) {
		List<GoodsInfo> hotGoodList = baseMapper.findHotGoodList(page, goodsInfo);
		return page.setRecords(hotGoodList);
	}

	@Override
	public GoodsInfo selectGoodDetailInfo(GoodsInfo goodsInfo) {
		return baseMapper.selectGoodDetailInfo(goodsInfo);
	}

	@Override
	public Page<GoodsInfo> findRecommendedGoodList(Page<GoodsInfo> page, GoodsInfo goodsInfo) {
		List<GoodsInfo> recommendedGoodList = baseMapper.findRecommendedGoodList(page, goodsInfo);
		return page.setRecords(recommendedGoodList);
	}

	@Override
	public Page<GoodsInfo> selectGoodsInfoPage(Page<GoodsInfo> page, GoodsInfo goodsInfo) {
		List<GoodsInfo> goodsInfos = baseMapper.selectPage(page, goodsInfo);
		return page.setRecords(goodsInfos);
	}
}
